import requests

headers = {
    'Accept': '*/*',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': 'keep-alive',
    'Content-Type': 'text/plain',
    'Origin': 'https://tjj.sh.gov.cn',
    'Referer': 'https://tjj.sh.gov.cn/',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'cross-site',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
    'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
}

data = '{"cid":"j9AP2YpnK0eHyROY20peQyOCRwxZx6xK","uid":"j9AP2YpnK0eHyROY20peQyOCRwxZx6xK","query":"政府","current":"1","size":20,"disable_correction":false,"facets":{"view":[{"type":"value","name":"view","sort":{"count":"desc"},"size":10}]},"input_type":"Input"}'.encode()

response = requests.post('https://ss.shanghai.gov.cn/manda-app/api/app/search/v1/8hn0uu/search', headers=headers, data=data)


for item in response.json()['result']['items']:
    print(item)